package Service;

import Bean.Administrator;
import Dao.AdministratorDao;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 张
 * Date: 2025-03-09
 * Time: 12:23
 */
public class AdministratorService {
    private AdministratorDao administratorDao = new AdministratorDao();

    //管理员登录
    public Administrator Login(Administrator loginAdmit) {
        Administrator admin = administratorDao.selectByName(loginAdmit.getUsername());
        if(admin == null) {
            return null;
        }
        if(loginAdmit.getPassword().equals(admin.getPassword())) {
            return admin;
        }
        return null;
    }
}
